import axios from "axios";

export function getFormData(id) {
  return axios.get(`/api/prUserProject/${id}`);
}

export function fetchProjectLogicByProjectKey(project_key) {
  return axios.get("/api/prProjectCommon/fetchProjectLogicByProjectKey", {
    params: { project_key },
  });
}

//
export function fetchPrUserProjectSettingByProjectKey(projectKey) {
  return axios.get(
    `/api/prProjectCommon/fetchPrUserProjectSettingByProjectKey?project_key=${projectKey}`
  );
}

/**
 *
 * @param {*} id 后端表单id
 * @returns
 */
export function submitForm(form) {
  return axios.post(`/api/prProjectCommon/submitForm/${form.projectKey}`, form);
}
